/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package RMI;

import java.sql.ResultSet;

/**
 *
 * @author TNT
 */
public class Help {
    Connect connect;
    ResultSet rs;
    public String chuoi[];
    public Help(String[] chuoi){
        this.chuoi = chuoi;
        connect = new Connect(chuoi);
    }
    public void addHelp(String email, String name, String question){
        
        String sql1 = "select max(id) from help";
        
        try{
            int id =0 ;
            rs = connect.st.executeQuery(sql1);
            while(rs.next()){
                id = Integer.parseInt(rs.getString("max(id)"));
                System.out.println(id);
            }
            id++;
            System.out.println(id);
            String sql2 = "insert into help values('"+id+"','"+email+"','"+name+"','"+question+"')";
            System.out.println(sql2);
            connect.st.execute(sql2);
            connect.con.close();
        }
        catch(Exception ex){}
        
    }
}
